﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:Tinter.Wpf.Client.Converters">

    <local:LinearGradientBrushConverter x:Key="bgBrushConverter"/>
    <!-- Colors-->
    <Color x:Key="colorOuterGlow">LightSkyBlue</Color>

	<!--Control colors.-->
	<Color x:Key="WindowColor">#FFE8EDF9</Color>
	<Color x:Key="ContentAreaColorLight">#FFC5CBF9</Color>
	<Color x:Key="ContentAreaColorDark">#FF7381F9</Color>

	<Color x:Key="DisabledControlLightColor">#FFE8EDF9</Color>
	<Color x:Key="DisabledControlDarkColor">#FFC5CBF9</Color>
	<Color x:Key="DisabledForegroundColor">#FF888888</Color>

	<Color x:Key="SelectedBackgroundColor">#FFC5CBF9</Color>
	<Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>

	<Color x:Key="ControlLightColor">White</Color>
	<Color x:Key="ControlMediumColor">#FF7381F9</Color>
	<Color x:Key="ControlDarkColor">#FF211AA9</Color>

	<Color x:Key="ControlMouseOverColor">#FF3843C4</Color>
	<Color x:Key="ControlPressedColor">#FF211AA9</Color>


	<Color x:Key="GlyphColor">#FF444444</Color>
	<Color x:Key="GlyphMouseOver">sc#1, 0.004391443, 0.002428215, 0.242281124</Color>

	<!--Border colors-->
	<Color x:Key="BorderLightColor">#FFCCCCCC</Color>
	<Color x:Key="BorderMediumColor">#FF888888</Color>
	<Color x:Key="BorderDarkColor">#FF444444</Color>

	<Color x:Key="PressedBorderLightColor">#FF888888</Color>
	<Color x:Key="PressedBorderDarkColor">#FF444444</Color>

	<Color x:Key="DisabledBorderLightColor">#FFAAAAAA</Color>
	<Color x:Key="DisabledBorderDarkColor">#FF888888</Color>

	<Color x:Key="DefaultBorderBrushDarkColor">Black</Color>

	<!--Control-specific resources.-->
	<Color x:Key="HeaderTopColor">#FFC5CBF9</Color>
	<Color x:Key="DatagridCurrentCellBorderColor">Black</Color>
	<Color x:Key="SliderTrackDarkColor">#FFC5CBF9</Color>

	<Color x:Key="NavButtonFrameColor">#FF3843C4</Color>

	<LinearGradientBrush x:Key="MenuPopupBrush" EndPoint="0.5,1" StartPoint="0.5,0">
	  <GradientStop Color="{DynamicResource ControlLightColor}" Offset="0" />
	  <GradientStop Color="{DynamicResource ControlMediumColor}" Offset="0.5" />
	  <GradientStop Color="{DynamicResource ControlLightColor}" Offset="1" />
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill" StartPoint="0,0" EndPoint="1,0">
	  <LinearGradientBrush.GradientStops>
	    <GradientStopCollection>
	      <GradientStop Color="#000000FF" Offset="0" />
	      <GradientStop Color="#600000FF" Offset="0.4" />
	      <GradientStop Color="#600000FF" Offset="0.6" />
	      <GradientStop Color="#000000FF" Offset="1" />
	    </GradientStopCollection>
	  </LinearGradientBrush.GradientStops>
	</LinearGradientBrush>

    <!-- FocusVisual -->
    <Style x:Key="controlFocusVisual" TargetType="Control">
        <!--<Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle Margin="2" StrokeThickness="1" Stroke="#60000000" StrokeDashArray="1 2" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>-->
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect BlurRadius="8" Color="{StaticResource colorOuterGlow}" ShadowDepth="0" Direction="0"/>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- Control base style-->
    <Style x:Key="controlBaseStyle" TargetType="Control">
        <Setter Property="FocusVisualStyle" Value="{StaticResource controlFocusVisual}" />
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect BlurRadius="8" Color="{StaticResource colorOuterGlow}" ShadowDepth="0" Direction="0"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Button.IsPressed" Value="True">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect BlurRadius="3" Color="{StaticResource colorOuterGlow}" ShadowDepth="0" Direction="0"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- TextBox Style -->
    <Style TargetType="TextBox" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- RichTextBox Style -->
    <Style TargetType="RichTextBox" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- Button Style -->
    <Style x:Name="mybutton" TargetType="Button" BasedOn="{StaticResource controlBaseStyle}">
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="MinHeight" Value="25" />
        <Setter Property="MinWidth" Value="75" />
        <Setter Property="BorderBrush" Value="Gray"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="BackBorder">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop x:Name="BackBeginColorStop" Color="White" Offset="0" />
                                <GradientStop x:Name="BackEndColorStop" Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="1.2" />
                            </LinearGradientBrush>
                        </Border.Background>
                        <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="0" BorderThickness="1" TextBlock.Foreground="{TemplateBinding Foreground}">
                            <Border.Background>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                    <GradientStop Offset="0" Color="White"/>
                                    <GradientStop Offset="1" Color="Transparent"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <ContentPresenter x:Name="Content" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True">
                            <ContentPresenter.Effect>
                                <DropShadowEffect ShadowDepth="4" Direction="-50" Opacity=".5"/>
                            </ContentPresenter.Effect>
                        </ContentPresenter>
                        </Border>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                    <VisualTransition GeneratedDuration="0" To="Pressed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <!--<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="Border">
                                            <EasingColorKeyFrame KeyTime="0" Value="#5EEE" />
                                        </ColorAnimationUsingKeyFrames>-->
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Offset" Storyboard.TargetName="BackEndColorStop">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="Color" Storyboard.TargetName="BackBeginColorStop">
                                            <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FDDD" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Offset" Storyboard.TargetName="BackEndColorStop">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="Color" Storyboard.TargetName="BackBeginColorStop">
                                            <EasingColorKeyFrame KeyTime="0" Value="#FDDD" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Effect.(DropShadowEffect.ShadowDepth)" Storyboard.TargetName="Content">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackBorder">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledControlDarkColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="BackBorder">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" Storyboard.TargetName="BackBorder">
                                            <EasingColorKeyFrame KeyTime="0" Value="{StaticResource DisabledBorderDarkColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <TranslateTransform X="1" Y="1"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- CheckBox Style -->
    <Style TargetType="CheckBox" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- ComboBox Style -->
    <Style TargetType="ComboBox" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- RadioButton Style -->
    <Style TargetType="RadioButton" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- PasswordBox Style -->
    <Style TargetType="PasswordBox" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- ProgressBar Style -->
    <Style TargetType="ProgressBar" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- Slider Style -->
    <Style TargetType="Slider" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- Expander Style -->
    <Style TargetType="Expander" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <!-- Label Style -->
    <Style TargetType="Label" BasedOn="{StaticResource controlBaseStyle}">
        <Style.Triggers>
        </Style.Triggers>
    </Style>

    <Style TargetType ="Hyperlink">
        <Setter Property ="Foreground"  Value ="#209AC2" />

        <Setter Property ="TextBlock.TextDecorations"  Value ="{x:Null}"/>
        <Style.Triggers >
            <Trigger Property ="IsMouseOver" Value ="True" >
                <Setter Property ="Foreground" Value ="#F27D00"/>
                <Setter Property ="TextBlock.TextDecorations">
                    <Setter.Value >
                        <TextDecorationCollection>
                            <TextDecoration Location ="Underline"/>
                        </TextDecorationCollection >
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>